package com.yhsoft.wxprogram.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 *
 */
@Component
public class ConstantPropertiesUtils implements InitializingBean {


    @Value("${weixin.appid}")
    private String appid;

    @Value("${weixin.partner}")
    private String partner;

    @Value("${weixin.partnerkey}")
    private String partnerkey;

    @Value("${weixin.notifyurl}")
    private String notifyurl;

    @Value("${weixin.apiV3Key}")
    private String apiV3Key;

    @Value("${weixin.cert}")
    private String cert;

    @Value("${weixin.key}")
    private String key;

    @Value("${weixin.domain}")
    private String domain;

    @Value("${weixin.refundDomain}")
    private String refundDomain;

    @Value("${weixin.serialNo}")
    private String serialNo;

    public static String REFUND_DOMAIN;
    public static String DOMAIN;
    public static String CERT;

    public static String KEY;
    public static String APIV3KEY;
    public static String APPID;
    public static String PARTNER;
    public static String PARTNERKEY;
    public static String NOTIFYURL;

    public static String SERIALNO;

    @Override
    public void afterPropertiesSet() throws Exception {
        APPID = appid;
        PARTNER = partner;
        PARTNERKEY = partnerkey;
        NOTIFYURL = notifyurl;
        APIV3KEY = apiV3Key;
        CERT = cert;
        DOMAIN = domain;
        REFUND_DOMAIN = refundDomain;
        KEY = key;
        SERIALNO = serialNo;
    }
}
